<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>show goods</title>
<style type="text/css">
.even {
	background-color: green
}
</style>
</head>
<body style="text-align: center; margin: 0 auto;">
	<h1>show goods</h1>

	<c:forEach items="${sessionScope.wares}" var="w" varStatus="a">
		<c:if test="${w.id eq wid}">
			<a class="even" href="show?wid=${w.id}">${w.addr}</a>
		</c:if>
		<c:if test="${w.id ne wid}">
			<a href="show?wid=${w.id}">${w.addr}</a>
		</c:if>
	</c:forEach>



	<table style="text-align: center; margin: 0 auto;">
		<thead>
			<tr>
				<td>name</td>
				<td>price</td>
				<td>number</td>
				<td>date</td>
				<td>warehouse</td>
				<td>operate</td>
				<td>operate</td>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${goods}" var="gg">
				<tr>
					<td>${gg.name}</td>
					<td>${gg.price}</td>
					<td>${gg.num}</td>
					<td><fmt:formatDate value="${gg.pdate}" pattern="yyyy-MM-dd" /></td>
					<td><a href="del?id=${gg.id}&wid=${gg.wid}">delete</td>
					<td><a href="perGood?id=${gg.id}&wid=${gg.wid}">update</td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
</body>
</html>